package com.kms.util;

import java.text.SimpleDateFormat;
import java.util.Date;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

public class TBSMonitorStartupServlet extends HttpServlet {

	/**
	 * 
	 */
	private static final long serialVersionUID = -6861966320764187131L;

	@Override
	public void init(ServletConfig config) throws ServletException {
		while(true){
			SimpleDateFormat sdf  = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
			String date = sdf.format(new Date());
			CoreUtil.addContentToFile(Container.TBS_MONITOR_FILE_DIR, date+"----"+Container.TBSMONITOR_STATUS+"\n");
			try {
				Thread.sleep(Container.REFRESH_RATE);
			} catch (InterruptedException e) {
			}
		}
	}

}
